package com.example.springboot01;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

public class ImageUtil {

    public static int [] readPixelColor(int x, int y){
        try {
            BufferedImage image = ImageIO.read(new File(""));
            final int rgb = image.getRGB(x, y);
            final Color color = new Color(rgb);
            final int red = color.getRed();
            final int green = color.getGreen();
            final int blue = color.getBlue();
            return new int[] {red, green, blue};
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }
}
